"""
for循环：
for index in string:
    代码块
for index in range(100):
    代码块
"""
# str = "hello python"
# for index in str:
#     if "o" == index:
#         print("跳过")
#         pass# 不执行任何东西，直接通过
#         # break
#         # continue
#     print(index)
# else:
#     print("end")
# for index in range(len(str)):
#     print(str[index])
# 九九乘法表
# for i in range(1,10):
#     for j in range(1,i + 1):
#         # end="",是不会换行，默认end="\n"，是会换行
#         # java print()进行输出
#         print(f"{j} * {i} = {i * j}" ,end="\t")
#     print()
# else:
#     print("九九乘法表运行结束")
# 打印三角形
# size = int(input("请输入三角形长度："))

# for i in range(size+1):
#     # for j in range(i):
#     #     print(" * ",end="")
#     print(" * " * i)
# print()
# for i in range(size,0,-1):# -1 是步长，
#     # for j in range(i, size):
#     #     print(" * ",end="")
#     # print()
#    print(" * " * i)
# print()
# for i in range(size + 1):
#     space = "   " * (size - i)
#     stars = " * " * i
#     print(space + stars)
# print()
# for i in range(size+1):
#     space = "   " * (size - i)
#     stars = " * " * i
#     print(space + stars)

# 步长
# str = "helloworld"
#
# for index in range(0,len(str)):
#     print(str[index])

"""
while 条件：
    代码
else:
    代码
"""
# 1-100的和
num = 1
result = 0
while num <= 100:
    result += num
    num += 1
print(result)